﻿<include file='Admin/Tpl/Public/nav.html' />
			<!-- END SIDEBAR RIGHT HEADING -->			
<style>
	.use{cursor:pointer}
	td{text-align: center;}
	.save:hover{font-weight: bold;color:#74AD3B;}
	.delete:hover{font-weight:bold;color:#F2745F;}
</style>			
<!-- BEGIN SIDEBAR RIGHT -->
	<div class="sidebar-right sidebar-nicescroller">
		<div class="tab-content">
			<div class="tab-pane fade in active" id="online-user-sidebar">
				<ul class="sidebar-menu online-user">
					<li class="static">ONLINE USERS</li>
					<li><a href="#fakelink">
							<span class="user-status success"></span>
							<img src="assets/img/avatar/avatar-2.jpg" class="ava-sidebar img-circle" alt="Avatar">
							<i class="fa fa-mobile-phone device-status"></i>
								Thomas White 
							<span class="small-caps">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</span>
						</a>
					</li>
					<li><a href="#fakelink">
							<span class="user-status success"></span>
							<img src="assets/img/avatar/avatar-3.jpg" class="ava-sidebar img-circle" alt="Avatar">
							Doina Slaivici
							<span class="small-caps">Duis autem vel eum iriure dolor in hendrerit in </span>
						</a>
					</li>
					<li><a href="#fakelink">
							<span class="user-status success"></span>
							<img src="assets/img/avatar/avatar-4.jpg" class="ava-sidebar img-circle" alt="Avatar">
							<i class="fa fa-android device-status"></i>
							Harry Nichols
							<span class="small-caps">I think so</span>
						</a>
					</li>
					<li><a href="#fakelink">
							<span class="user-status success"></span>
							<img src="assets/img/avatar/avatar-5.jpg" class="ava-sidebar img-circle" alt="Avatar">
							<i class="fa fa-mobile-phone device-status"></i>
							Mihaela Cihac
							<span class="small-caps">Yes, I'll be waiting</span>
						</a>
					</li>
					<li><a href="#fakelink">
							<span class="user-status success"></span>
							<img src="assets/img/avatar/avatar-6.jpg" class="ava-sidebar img-circle" alt="Avatar">
							<i class="fa fa-apple device-status"></i>
							Harold Chavez
							<span class="small-caps">Thank you!</span>
						</a>
					</li>
						
					<li class="static">IDLE USERS</li>
					<li><a href="#fakelink">
							<span class="user-status warning"></span>
							<img src="assets/img/avatar/avatar-7.jpg" class="ava-sidebar img-circle" alt="Avatar">
							<i class="fa fa-windows device-status"></i>
							Elizabeth Owens
							<span class="small-caps">2 hours</span>
						</a>
					</li>
					<li><a href="#fakelink">
							<span class="user-status warning"></span>
							<img src="assets/img/avatar/avatar-8.jpg" class="ava-sidebar img-circle" alt="Avatar">
							<i class="fa fa-apple device-status"></i>
							Frank Oliver
							<span class="small-caps">4 hours</span>
						</a>
					</li>
					<li><a href="#fakelink">
							<span class="user-status warning"></span>
							<img src="assets/img/avatar/avatar-9.jpg" class="ava-sidebar img-circle" alt="Avatar">
							Mya Weastell
							<span class="small-caps">15 minutes</span>
						</a>
					</li>
					<li><a href="#fakelink">
							<span class="user-status warning"></span>
							<img src="assets/img/avatar/avatar-10.jpg" class="ava-sidebar img-circle" alt="Avatar">
							<i class="fa fa-mobile-phone device-status"></i>
							Carl Rodriguez
							<span class="small-caps">20 hours</span>
						</a>
					</li>
					<li><a href="#fakelink">
							<span class="user-status warning"></span>
							<img src="assets/img/avatar/avatar-11.jpg" class="ava-sidebar img-circle" alt="Avatar">
							<i class="fa fa-mobile-phone device-status"></i>
							Nikita Carter
							<span class="small-caps">2 minutes</span>
						</a>
					</li>
						
					<li class="static">OFFLINE USERS</li>
					<li><a href="#fakelink">
							<span class="user-status danger"></span>
							<img src="assets/img/avatar/avatar-12.jpg" class="ava-sidebar img-circle" alt="Avatar">
							Craig Dixon
							<span class="small-caps">Last seen 2 hours ago</span>
						</a>
					</li>
					<li><a href="#fakelink">
							<span class="user-status danger"></span>
							<img src="assets/img/avatar/avatar-13.jpg" class="ava-sidebar img-circle" alt="Avatar">
							Mikayla King
							<span class="small-caps">Last seen yesterday</span>
						</a>
					</li>
					<li><a href="#fakelink">
							<span class="user-status danger"></span>
							<img src="assets/img/avatar/avatar-14.jpg" class="ava-sidebar img-circle" alt="Avatar">
							Richard Dixon
							<span class="small-caps">Last seen Feb 20, 2014 05:45:50</span>
						</a>
					</li>
					<li><a href="#fakelink">
							<span class="user-status danger"></span>
							<img src="assets/img/avatar/avatar-15.jpg" class="ava-sidebar img-circle" alt="Avatar">
							Brenda Fuller
							<span class="small-caps">Last seen Feb 15, 2014 11:35:50</span>
						</a>
					</li>
					<li><a href="#fakelink">
							<span class="user-status danger"></span>
							<img src="assets/img/avatar/avatar-16.jpg" class="ava-sidebar img-circle" alt="Avatar">
							Ryan Ortega
							<span class="small-caps">Last seen Jan 20, 2014 03:45:50</span>
						</a>
					</li>
				</ul>
			</div>
		</div><!-- /.tab-content -->
	</div><!-- /.sidebar-right -->
<!-- END SIDEBAR RIGHT -->	
			
<!-- BEGIN PAGE CONTENT -->
	<div class="page-content">				
				
		<div class="container-fluid">
		<!-- Begin page heading -->
			<h1 class="page-heading">Team In　<small>公司部门管理</small></h1>
		<!-- End page heading -->
				
		<!-- Begin breadcrumb -->
			<ol class="breadcrumb default square rsaquo sm">
				<li><a href="index.html"><i class="fa fa-home"></i></a></li>
				<li><a href="#fakelink">Teamin</a></li>
				<li class="active">部门列表</li>
			</ol>
			<div id="div_box" class="the-box no-border">
				<div class="btn-group groups">
	                       <a href="__URL__/forAct" class="btn btn-success"><i class="fa fa-plus"></i> 添加新的部门</a>
	                 </div>
	                 <div class="btn-group groups">
	                       <span type="button" class="btn btn-danger">部门列表</span>
	                 </div>
                       <div class="div_search table-responsive div1">
							<!-- End breadcrumb -->							
					<table class="table table-th-block table-hover">
                        		<thead>
	                            		<tr>
			                             <td width="60px" style="text-align:center">编号</td>
			                             <td>部门名称</td>
			                             <td width="100px">部门负责人</td>
			                             <td width="100px">人事负责人</td>
			                             <td>隶属部门</td>
			                             <td width="100px">操作</td>
	                            		</tr>
                        		</thead>                       
			                 <tbody>
			                       <foreach name="data" key="key" item="value">
			                       <tr>
			                             <td>{$value.department_id}</td>
			                             <td>{$value.department_name}</td>                                  
			                             <td>{$audience[$value['leader_id']]['audience_name']}</td>
			                             <td>{$audience[$value['leader_id']]['audience_name']}</td>
			                             <td>{$pid[$value['department_pid']]['department_name']}</td>
			                             <td style="width:90px;">
			                                  <span class="save" name="{$value.department_id}" style="cursor:pointer">修改</span>
			                                   &nbsp;|&nbsp;
			                                   <span class="delete" id="{$value.department_id}" style="cursor:pointer">删除</span>
			                             </td>
			                       </tr>
			                       </foreach>
			                 </tbody>
                    		</table>
                    		<ul class="pagination success">{$page}</ul>
				</div>
			</div>
					
		</div><!-- /.container-fluid -->
				
	<!-- BEGIN FOOTER -->
		<footer></footer>
	<!-- END FOOTER -->
				
	</div><!-- /.page-content -->
</div><!-- /.wrapper -->
<!-- END PAGE CONTENT -->	
		
</body>
<script type="text/javascript">
//部门查询
$("#search").keyup(function(){
    var name = $(this).val();
    $.ajax({
        url:"__URL__/search",
        data:{"search":name},
        type:"post",
        success:function(data){
        	//alert(data);
           $(".div_search").html(data);
        }
    });
});
	//分页颜色
	$(".current").css({background:"#8CC152",color:"white"});
	//删除
	$(".delete").on("click",function(){
        var id = $(this).attr("id");
       
        if(confirm("确认删除?")){
        $.ajax({
            url:"__URL__/delAct",
            data:{"department_id":id},
            type:"post",
            dataType:"json",
            success:function(data){
               	if(data.state==1){
               		alert("删除成功");
               		window.location="__SELF__";
               	}else{
               		alert("删除失败");
               		window.location="__SELF__";
               	}                       	
               
            }
        })
        }
     });

	//修改
	$(".save").on("click",function(){
        var id = $(this).attr("name");
        $.ajax({
            url:"__URL__/to_update",
            data:{"department_id":id},
            type:"get",
            success:function(data){
               $("#div_box").html(data);
            }
        })
       
     });
	</script>
</html>
